/// <reference path="../../../Content/shared/_variables-shared.scss" />
/// <reference path="../../../Content/shared/_mixins.scss" />
/// <reference path="_variables.scss" />
/// <reference path="../../../Content/bs4/scss/bootstrap.scss" />

//
// ShopBar layout
// --------------------------------------------------

.shopbar-section {
    padding: 1rem 0;
    background: $shopbar-bg;
}

.shopbar {
    margin: -0.5rem; 
    display: flex;
    flex-wrap: nowrap;
}

.shopbar-col-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    flex-grow: 0;
}

.shopbar-col {
    padding: 0.5rem 0.375rem;
    flex-grow: 0;
}

.shop-logo {
    margin-left: 0;
    transition: all 0.25s ease-out;

    .search-focused & {
        opacity: 0;
        transform: translateX(100%);
    }

    .brand {
        display: block;
        width: 150px;
        max-width: 150px;
        max-height: 60px;
        text-align: center;

        @media (min-width: 480px) {
            & { max-width: 200px; max-height: 80px; width: auto; }
        }

        @include media-breakpoint-up(lg) {
            & { max-width: 250px; max-height: 100px; width: auto; }
        }
    }
}

.shopbar-col-group-brand,
.shopbar-search  {
    flex-grow: 1;
}

.shopbar-tools {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: nowrap;
    width: 100%;
}

.shopbar-button {
    min-width: 60px;

    .shopbar-button-icon {
        font-size: 20px;
        line-height: 1;
        width: 1.25em;
        height: 1.25em;
        text-align: center;

        > i { font-size: inherit !important; }
    }

    .shopbar-button-label-sm {
        display: none;
        color: $header-color-muted;
        font-size: 10px;
        line-height: 1.3;
        vertical-align: middle;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    @include media-breakpoint-up(lg) {
        height: $input-height;
        .shopbar-button-icon { font-size: 28px; }
    }
}

@include media-breakpoint-down(md) {
    .shopbar-section {
        border-bottom: 1px solid rgba(#000, 0.12);
    }

    .shopbar {
        flex-wrap: wrap;
    }

    .shopbar-col-group-tools {
        width: 100%;
    }

    .shopbar-button {
        text-align: center;

        .shopbar-button-label {
            display: none !important;
        }

        .shopbar-button-label-sm {
            display: block;
        }
    }
}


//
// ShopBar Tools
// --------------------------------------------------

.shopbar-tool {
    position: relative;
}

.shopbar-button {
    display: block;
    text-decoration: none !important;
    padding: 0.35rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 0.125rem;
    transition: all 0.12s ease;
    cursor: pointer;

    &:active, .open &, .show & {
        background-image: none;
        outline: 0;
    }

    .shopbar-button-icon,
    .shopbar-button-label {
        display: inline-block;
        vertical-align: middle;
        position: relative;
        text-decoration: none;
    }

    .shopbar-button-label {
        font-size: $font-size-xs;
        line-height: 1.2;
        vertical-align: top;
    }
}


.shopbar-light {
    .shopbar-button { 
        color: $shopbar-color !important; 

        &:hover {
            border-color: rgba(#000, 0.12) rgba(#000, 0.12) rgba(#000, 0.12);
            box-shadow: 0 1px 0 rgba(#fff, 0.15) inset, 
                        0 1px 1px rgba(#000, 0.075);
        }

        &:active, .open &, .show & {
            border-color: #adadad;
            background-color: #e6e6e6;
            box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
        }

        .shopbar-button-label span { color: $shopbar-color-muted;  }
    }
}

.shopbar-inverse {
    .shopbar-button { 
        color: $shopbar-inverse-color !important; 

        &:hover {
            border-color: rgba(#fff, 0.2) rgba(#fff, 0.2) rgba(#fff, 0.2);
        }

        &:active, .open &, .show & {
            border-color: rgba(#fff, 0.2);
            background-color: $header-inverse-hover-bg;
            box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.3);
        }

        .shopbar-button-label span { color: $shopbar-inverse-color-muted;  }
    }
}





//
// Menu Styles (TODO: move later)
// --------------------------------------------------

.menubar-section {
    background: $menubar-bg;
    .abbreviation { text-transform: uppercase; }
}

.menubar {
    display: flex;
    flex-direction: row;
}

.menubar-group {
    display: flex;
    margin-left: 1rem;
}

.menubar-link {
    position: relative;
    display: block;
    font-size: $font-size-xs;
    padding: 1em 0.8em;
    text-decoration: none !important;
    text-transform: uppercase;

    > .menubar-icon {
        font-size: $font-size-base;
    }
}

.menubar-group--special {
    font-weight: $font-weight-medium;
}


.menubar-light {
    &.menubar-section { border-bottom: 1px solid $header-border-color; }
    .menubar-link {
        color: $menubar-color;
    }
    .menubar-link:hover,
    .menubar-link:active,
    .show .menubar-link {
        background-color: $header-hover-bg;
        color:  $menubar-color;
    }
    .menubar-group--special .menubar-link {
        color: darken($menubar-color, 15%) !important;
    }
}

.menubar-inverse {
    &.menubar-section { border-bottom: 1px solid $menubar-inverse-color; }
    .menubar-link {
        color: $menubar-inverse-color;
    }
    .menubar-link:hover,
    .menubar-link:active,
    .show .menubar-link {
        background-color: $header-inverse-hover-bg;
    }
}
